#version 330 core

layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aColor;

uniform int type;

// if fs not use this attribute
// it will optmiz by gpu compiler
out vec4 vertexColor;

void main()
{
    gl_Position =  vec4(aPos.x, aPos.y, aPos.z, 1.0);
    if (type == 1) {
        vertexColor = vec4(0.5, 0.0, 0.0, 1.0);
    } else if (type == 2) {
        vertexColor = vec4(aColor, 1.0);
    } else {
        vertexColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);
    }
}